Memory management in a computing environment involves reserving portions of the computer memory for the purpose of loading executable logic code (i.e., software programs) and later freeing the memory for reuse according to a certain memory management scheme. The process of reserving memory is typically referred to as “allocating” memory space to a logical object; and the process of freeing memory is typically referred to as “deallocating” the memory space.
The deallocating scheme, depending on the type of programming language used, sometimes includes a “garbage collection” process. The term “garbage” in this context refers to a memory space allocated to a logical object that no longer is needed for the proper execution of the program. Generally, when the so-called garbage object is collected, it means that the corresponding memory space is deallocated.
Manual and automatic memory management schemes have been implemented. In the manual scheme, a programmer will have to actively insert instructions in the logic code in order to identify and deallocate the memory space associated with unused objects. The automatic scheme is only used at the programming language level and causes a garbage collection cycle to start only when the system is detected to be low on memory.
Unfortunately, the above two schemes do not provide optimum results in memory intensive software applications, such as Internet-based applications (i.e., web applications) that support multitudes of sessions established between a web server and one or more client machines. Memory management becomes particularly burdensome and complex when a plurality of servlets are utilized to service a plurality of requests submitted from one or more clients to a web server during a web session, for example.
Typically, when memory is allocated to a logical object in a session, the memory remains allocated until the session is terminated, regardless of whether the task that corresponds to the logical object is in an active or inactive state during the entire length of the session. A complex web application may support and require the execution of many logical tasks and servlets during each session. If the garbage collection process is delayed until the end of each session or until the system is running low in memory, the web server's performance will be adversely affected because the web server may quickly run out of memory and not be able to recover.
Thus, memory management methods and systems are needed that can overcome the aforementioned shortcomings.